package cn.south.campus.business.model.vo;

import cn.south.campus.business.model.entity.ExpressTakeDetail;
import cn.south.campus.common.model.vo.BaseVO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/12/13 13:26
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ExpressTakeDetailVo extends BaseVO {
    /**
     * 代取快递id
     */
    private Long expressTakeId;
    /**
     * 驿站
     */
    private String expressStation;
    /**
     * 快递类型
     */
    private String type;
    /**
     * 金额
     */
    private BigDecimal price;

    /**
     * 快递图片/短信截图
     */
    private String picture;

    /**
     * 取件码
     */
    private String takeCode;

    public static ExpressTakeDetail convert(ExpressTakeDetailVo vo) {
        if (vo == null) {
            return null;
        }
        ExpressTakeDetail detail = new ExpressTakeDetail();
        detail.setId(vo.getId());
        detail.setExpressTakeId(vo.getExpressTakeId());
        detail.setType(vo.getType());
        detail.setPrice(vo.getPrice());
        detail.setPicture(vo.getPicture());
        detail.setExpressStation(vo.getExpressStation());
        detail.setTakeCode(vo.getTakeCode());
        return detail;
    }

    public static ExpressTakeDetailVo convert(ExpressTakeDetail detail) {
        if (detail == null) {
            return null;
        }
        ExpressTakeDetailVo detailVo = new ExpressTakeDetailVo();
        detailVo.setId(detail.getId());
        detailVo.setExpressTakeId(detail.getExpressTakeId());
        detailVo.setType(detail.getType());
        detailVo.setPrice(detail.getPrice());
        detailVo.setPicture(detail.getPicture());
        detailVo.setExpressStation(detail.getExpressStation());
        detailVo.setTakeCode(detail.getTakeCode());
        return detailVo;
    }

}
